package com.sishu.controller;

import com.sishu.service.StudentService;
import com.sishu.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@SuppressWarnings("rawtypes")
@RestController
@Slf4j
@RequestMapping("/student/")
@CrossOrigin(origins = "*")
public class StudentController {

    @Resource
    private StudentService studentService;


    @GetMapping("selectsname")//根据sid查询sname
    public Result selectsname(@Param("sId") String sId) {
        return studentService.selectsname(sId);
    }


    @GetMapping("getground")//得到土地
    public Result getground(@Param("groupId") String groupId, @Param("sId") String sId, @Param("locationType") String locationType) {

        return studentService.getground(groupId, sId, locationType);
    }


}
//        @GetMapping("setdiffculty")//设置困难度 应该用不到
//        public Result setdiffculty(@Param("userId") String userId,@Param("diffculty") String diffculty) {
//            return StudentService.updatediffculty(userId,diffculty);  //先查数据库中的teacherDiffculty
//        }